Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initialization strategy that randomly samples values #2482

Merged
merged 4 commits into from
May 15, 2020

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented May 15, 2020

Addresses #2426

This adds a new autoguide init strategy init_to_generated motivated by use in MCMC where 100 attempts are made to initialize the model. Previously those attempts were identical because init_to_value is unchanged across attempt. After this PR those attempts may randomly generate new samples.

Tested

  • unit tests
  • updated CompartmentalModel to use init_to_generated

fehiepsi
fehiepsi previously approved these changes May 15, 2020
Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I just have one comment about tweaking the docs of init_to_generated.

pyro/infer/autoguide/initialization.py Outdated Show resolved Hide resolved
if self._init is None or site["name"] in self._seen:
self._init = self.generate()
self._seen = {site["name"]}
return self._init(site)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic LGTM.

@fritzo fritzo changed the title Add initialization strategy to randomly sample values Add initialization strategy that randomly samples values May 15, 2020
@fehiepsi fehiepsi merged commit ff5ade4 into dev May 15, 2020
@fritzo fritzo deleted the init-to-generated branch June 5, 2020 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants